﻿@using System.Diagnostics;
@using System.Collections;
@using System.Reflection;
@using System.Runtime.Versioning;
@using Microsoft.Extensions.Caching.Memory
@using NewLife.Common;
@inject IMemoryCache Cache
@{
    //Layout = NewLife.Cube.Setting.Current.Layout;

    ViewBag.Title = "Cache列表";

    // 如果自己实现了IMemoryCache，手动修改此处
    var cache = Cache as MemoryCache;
    if (cache == null)
    {
        cache = new MemoryCache(new MemoryCacheOptions());
    }
}

<div class="layui-fluid" id="mainpage">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    Cache列表(@cache.Count)
                </div>
                <div class="layui-card-body">
                    <div class="layui-form layui-border-box layui-table-view">
                        <div class="layui-table-box">
                            <div class="layui-table-header">
                                <table class="layui-table" cellspacing="0" cellpadding="0" border="0" lay-size="sm" style="width:100%">
                                    <thead>
                                        <tr>
                                            <th>
                                                <div class="layui-table-cell laytable-cell-1-0-0" data-id="1-0-0">
                                                    <span>
                                                        名称
                                                    </span>
                                                </div>
                                            </th>
                                            <th>
                                                <div class="layui-table-cell laytable-cell-1-0-1" data-id="1-0-1">
                                                    <span>
                                                        类型
                                                    </span>
                                                </div>
                                            </th>
                                            <th>
                                                <div class="layui-table-cell laytable-cell-1-0-2" data-id="1-0-2">
                                                    <span>
                                                        数值
                                                    </span>
                                                </div>
                                            </th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="layui-table-body layui-table-main">
                                <table class="layui-table" cellspacing="0" cellpadding="0" border="0" lay-size="sm" style="width:100%">
                                    <tbody>
                                        @*@foreach (DictionaryEntry item in cache)
                                            {
                                            <tr>
                                                <td>
                                                    <div class="layui-table-cell laytable-cell-1-0-0" data-id="1-0-0">
                                                        @item.Key
                                                    </div>
                                                </td>
                                                <td>
                                                    <div class="layui-table-cell laytable-cell-1-0-1" data-id="1-0-1">
                                                        @item.Value.GetType().FullName
                                                    </div>
                                                </td>
                                                <td>
                                                    <div class="layui-table-cell laytable-cell-1-0-2" data-id="1-0-2">
                                                        @item.Value
                                                    </div>
                                                </td>
                                            </tr>
                                            }*@
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


@section scripts{
    <script>
        layui.use(['jquery'], function () {
            var $ = layui.$;

            setTableScroll();

            setTable();
        });
    </script>
}